// @ts-ignore
/* eslint-disable */
import request from '@/request'

/** addCoupon POST /api/coupon/add */
export async function addCouponUsingPost(
  body: API.CouponAddRequest,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseLong_>('/api/coupon/add', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  })
}

/** deleteCoupon POST /api/coupon/delete */
export async function deleteCouponUsingPost(
  body: API.DeleteRequest,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseBoolean_>('/api/coupon/delete', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  })
}

/** getCouponVOById GET /api/coupon/get/vo */
export async function getCouponVoByIdUsingGet(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.getCouponVOByIdUsingGETParams,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseCouponVO_>('/api/coupon/get/vo', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  })
}

/** listCanBuyCoupon GET /api/coupon/list/canBuy */
export async function listCanBuyCouponUsingGet(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.listCanBuyCouponUsingGETParams,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponsePageCouponVO_>('/api/coupon/list/canBuy', {
    method: 'GET',
    params: {
      // current has a default value: 1
      current: '1',
      // pageSize has a default value: 10
      pageSize: '10',
      ...params,
    },
    ...(options || {}),
  })
}

/** listCouponByPage POST /api/coupon/list/page */
export async function listCouponByPageUsingPost(
  body: API.CouponQueryRequest,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponsePageCoupon_>('/api/coupon/list/page', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  })
}

/** listCouponVOByPage POST /api/coupon/list/page/vo */
export async function listCouponVoByPageUsingPost(
  body: API.CouponQueryRequest,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponsePageCouponVO_>('/api/coupon/list/page/vo', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  })
}

/** listSeckillCoupon GET /api/coupon/list/seckillCoupon */
export async function listSeckillCouponUsingGet(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.listSeckillCouponUsingGETParams,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponsePageCouponVO_>('/api/coupon/list/seckillCoupon', {
    method: 'GET',
    params: {
      // current has a default value: 1
      current: '1',
      // pageSize has a default value: 10
      pageSize: '10',
      ...params,
    },
    ...(options || {}),
  })
}

/** updateCoupon POST /api/coupon/update */
export async function updateCouponUsingPost(
  body: API.CouponUpdateRequest,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseBoolean_>('/api/coupon/update', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  })
}
